﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="WpfApplication1.MainWindow"
        Title="Eight Ball" Height="300" Width="600">
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.New" Executed="CommandBinding_Executed"></CommandBinding>
    </Window.CommandBindings>
    <Grid x:Name="grid1">
        <Grid.Background>
            <LinearGradientBrush>
                <GradientStop Color="Yellow" Offset="0" />
                <GradientStop Color="Blue" Offset="0.5" />
                <GradientStop Color="Red" Offset="1" />
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <TextBox x:Name="txtQuestion" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
			FontFamily="宋体" FontSize="24" Foreground="Green" Height="50" d:IsHidden="True"
                 />
        <Button x:Name="cmdAnswer" Grid.Row="1" Width="100" Height="50" Content="New"
			 Command="New" >
        </Button>

        <Slider Name="sl" Margin="3" Minimum="10" Maximum="50" Value="10" TickFrequency="1" TickPlacement="TopLeft"></Slider>
        <TextBlock Margin="20" Name="lbl" FontSize="{Binding ElementName=sl, Path=Value,Mode=TwoWay}">
            <TextBlock.Text>
                <Binding Path="Title">
                    <Binding.RelativeSource>
                        <RelativeSource Mode="FindAncestor" AncestorType="{x:Type Window}" />
                    </Binding.RelativeSource>
                </Binding>
            </TextBlock.Text>
        </TextBlock>
        <ToolBarPanel/>
    </Grid>
</Window>
